<?php
myPrint($arOut, '$arOut');

echo '<script type="text/javascript">'."\n";

echo 'var errorFields = {'."\n".' 0: 0'."\n";
foreach($arOut as $name=>$value) echo ' ,"'.$name.'": "'.$value.'"'."\n";
echo '}'."\n";	
		
echo 'DOMReady( outMessByFields );
function outMessByFields(){
	for(var name in errorFields) {
		var el=document.getElementById( name );
		if( el!=null ){
			var newEl = document.createElement("div");
			newEl.className="error";
			newEl.appendChild( document.createTextNode( errorFields[ name ]) );
			el.parentNode.appendChild( newEl );//, el.nextSibling
		};
	};
}';

echo '</script>'."\n";

?>